package com.hkts.naturalgasauthentication.base.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.hkts.naturalgasauthentication.common.constant.CommonConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;

@Table(name = "permission")
@Entity
@Data
public class Permission extends ManagementBaseEntity{

    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "id")
    private String id;

    @Column(name = "name")
    private String name;

    @Column(name = "showAlways")
    private Boolean showAlways = true;

    @Column(name = "level")
    private Integer level;

    @Column(name = "type")
    private Integer type;

    @Column(name = "title")
    private String title;

    @Column(name = "path")
    private String path;

    @Column(name = "component")
    private String component;

    @Column(name = "icon")
    private String icon;

    @Column(name = "buttonType")
    private String buttonType;

    @Column(name = "parent_id")
    private String parentId;

    @Column(name = "description")
    private String description;

    @Column(name = "sortOrder")
    private BigDecimal sortOrder;

    @Column(name = "hidden")
    private Boolean hidden = true;

    @Column(name = "url")
    private String url;

    @Transient
    private List<Permission> children;

    @Transient
    private List<String> permTypes;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty("父级名称")
    private String prentName;

    @Transient
    private Boolean expand = true;

    @Transient
    private Boolean checked = false;

    @Transient
    private Boolean selected = false;
}
